$(function () {
    // alert("sakjfd");
    $("#adminlogin").click(function(event) {
        // alert("ddddddddddddd");
        var name = $(".name>input").val();
        var password = $(".password>input").val();
        // alert(name);
        if(name == ""){
            alert("请输入用户名");
            return false;
        }else if(password == ""){
            alert("请输入密码");
            return false;
        }
        var data= {name:name,password:password};
        jQuery.ajax({
            url: 'http://localhost:8080/login.action',
            type: 'POST',
            dataType: 'json',
            contentType:'application/json',
            data: JSON.stringify(data),
            complete: function(xhr, textStatus) {
                // alert("complete");
            },
            success: function(data, textStatus, xhr) {
                // console.log(JSON.parse(data)[0] );
                window.location.href="solutions.html?"+data;
            },
            error: function(xhr, textStatus, errorThrown) {
                // alert(errorThrown);
                window.location.href="error-500.html";
            }
        });




    });
});